home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / scope / 001-025 / scopedisk12 / popfunc / popfuncs.doc < prev    next >
Text File  |  1995-03-18  |  23KB  |  514 lines

  1.  
  2.                ******************************************
  3.                **            POPFUNCS V2.1             **
  4.                **       Written by Tom Krehbiel        **
  5.                **              June 1988               **
  6.                ******************************************
  7.  
  8.  
  9.     This program in it's executable form is being released as ShareWare
  10. (user supported software).  Feel free to give a copy to anyone who wants
  11. one; just make sure you: 1) give them all the files listed below, and
  12. 2) charge no money for it.  If you feel that this program has been useful
  13. to you, a small donation of five or ten dollars would be GREATLY
  14. appreciated.  This will encourage me to continue to upgrade this and other
  15. programs.  I'm also curious just how many people this program gets to, so
  16. send me a postcard or something.  Send comments/bug reports/donations to:
  17.  
  18.     Tom Krehbiel
  19.     10747 Surry Road
  20.     Chester, VA  23831
  21.  
  22.     I can also be reached through David Krehbiel (yes, we're related) on
  23. Compuserve (70701,1515).
  24.  
  25.     If you do find a bug (and I'm sure there's at least a few left), please
  26. describe the conditions under which the program bombed so I can better
  27. correct the problem.
  28.  
  29.  
  30.     IN THE ARC FILE
  31.  
  32. The following files should be included in the ARC file:
  33.  
  34.     PopFuncs                The main program
  35.     PopFuncs.info           The icon for the main program
  36.     PopFuncs.doc            This document
  37.     Default.fkeys           Sample macro file
  38.     README                  How to set up PopFuncs
  39.     EXECUTE.ME              To rename all the files properly
  40.  
  41.  
  42.     Okay, on to more important things...
  43.  
  44.  
  45.     FEATURES
  46.  
  47.     * Useable from WorkBench or CLI (though it's not as useful from WB).
  48.     * Easily user-definable keyboard macros.
  49.     * 'Pause' feature to temporarily disable PopFuncs.
  50.     * Supports saving/loading macro files.
  51.     * Window manipulations can be embedded in the macros.
  52.     * User-definable 'hot keys.'
  53.     * Run any program in the background at the touch of a key.
  54.     * Screen blanking after a user-definable length of time.
  55.     * Allows 'screen shuffling' with left-amiga-M.
  56.     * Window 'latching' to recall specific windows at a keypress.
  57.  
  58.  
  59.     NEW TO 2.1
  60.  
  61. The following things have changed since V2.0:
  62.  
  63.     - A problem with window enlarging was fixed.
  64.     - Added {n} to simulate pressing the return key.
  65.     - An UNDO gadget was added to the define window.
  66.     - A CLEAR gadget was also added to the define window.
  67.     - The input handler was revised considerably.
  68.     - The window 'latching' feature was added.
  69.  
  70.  
  71.     HOW TO RUN IT
  72.  
  73. PopFuncs can be run from the CLI as follows:
  74.  
  75.     Run >Nil: PopFuncs [macro file]
  76.  
  77. where 'macro file' is an optional file of macros to load in on startup.
  78. If 'macro file' cannot be found, then the file 'S:Default.fkeys' is loaded.
  79. If this file doesn't exist either, then the macro definitions will be blank
  80. on startup and you'll have to either load macro definitions or type them
  81. in yourself.
  82.  
  83. This can also be put into your startup-sequence so it will run
  84. automatically on boot-up.
  85.  
  86. The ">nil:" will enable you to remove the CLI that PopFuncs was started
  87. from.  This isn't required, but if you put this in your startup sequence
  88. and do an 'EndCLI' at the end, then you would probably want to put the
  89. ">nil:" in the command.
  90.  
  91. It can also be started from the WorkBench simply by double-clicking on
  92. its icon.  Although some features are useful from WorkBench (most notably
  93. the window manipulations and background-program-running), PopFuncs is much
  94. more effective from CLI.
  95.  
  96.  
  97.     THE DEFINITION WINDOW
  98.  
  99. By pressing ALT-D while the program is running, a window will pop up (hence
  100. the name 'PopFuncs') giving you the current macro definitions. Clicking in
  101. any of the string gadgets labeled F1-S10 with the left mouse button allows
  102. you to change the text of the macros as you would with any string gadgets.
  103.  
  104. The string gadget under the macro text gadgets, labeled 'Blank Time', is
  105. for setting the screen blanking time.  See SCREEN BLANKING below.
  106.  
  107. The three tiny string gadgets under the macro definitions, labelled
  108. 'Kill:', 'Define:', and 'Pause:',allow you to change the 'hot keys' that
  109. perform various functions.  For example, if you're using Scribble!, which
  110. uses ALT-P to set a page-break, you could click in the PAUSE gadget and
  111. change the P to an S.  Then, any time you hit ALT-S, PopFuncs will pause.
  112. You can use any ASCII character from space to DEL.  WARNING:  Make sure all
  113. three of the 'hot keys' are different. Results are unpredictable if any two
  114. are the same.  I hope this isn't a problem.
  115.  
  116. The UNDO gadget will restore the macros to whatever state they were in when
  117. you first popped up the window.  So if you completely screw up a macro, you
  118. can hit undo and all will be saved.
  119.  
  120. The CLEAR gadget clears out all of the macros, leaving a blank slate.  If
  121. you accidently hit clear, don't worry -- just hit undo.
  122.  
  123. The OK gadget simply removes the definition window and let's you continue
  124. normal use.  Note that all of PopFuncs' features (except screen blanking)
  125. are inactive while the definition window is up.
  126.  
  127. SAVE allows you to save the current macro definitions to a file of your
  128. choice.  It saves the macro definitions, the blank time, the three
  129. definable 'hot keys,' and all of the window latches (see below).  Sorry
  130. about the pitiful file requester, but I wanted to keep this program as
  131. small as possible.  Later on I might add a better requester, but for right
  132. now, this one will do.
  133.  
  134. LOAD (coincidentally) allows you to load in a macro file from disk.  See
  135. MACRO FILE CONTENTS below.
  136.  
  137. Note:  If you're lazy and don't like to use the mouse, you can type the
  138. first letter of any of the bottom gadget names and have it perform that
  139. functions.  For example, hitting 's' (lower case only) will bring up the
  140. save file requester.  You can also hit RETURN for OK and ESC for UNDO.
  141. Also, the number keys activate the unshifted function key string gadgets,
  142. and the shifted number keys activate the shifted function key string
  143. gadgets.  For example, hitting '4' on the keyboard activates the F4 string
  144. gadget, and shift '4' would activate the S4 string gadget.
  145.  
  146. NOTE:  All of the functions of PopFuncs (except the screen blanking) are
  147. disabled while the definition window is displayed.
  148.  
  149.  
  150.     "PAUSING"
  151.  
  152. Pressing ALT-P will temporarily 'pause' PopFuncs.  This turns off the
  153. trapping of every key except ALT-P again.  This can be used if a program
  154. you are running has its own definitions for the functions keys and you'd
  155. rather use them.  While paused, PopFuncs displays a small window with the
  156. message 'PopFuncs sleeping...' to let you know it's not doing anything. To
  157. restart it, just hit ALT-P again.
  158.  
  159.  
  160.     SCREEN BLANKING
  161.  
  162. PopFuncs supports variable-time length screen blanking.  This means that
  163. after a certain amount of time of inactivity that you define, the screen
  164. will be blanked to avoid video burn-in.  In the definition window
  165. underneath the macro string gadgets is another (another) string gadget that
  166. defines the number of minutes that must elapse before screen-blanking.
  167.  
  168. The default value is ten minutes.
  169.  
  170. NOTE:  Serial and parallel port activity is NOT considered activity.  That
  171. is, if you're in a terminal program and just watching a bunch text scroll
  172. by, the screen WILL blank after the set time has expired.  Sorry.
  173.  
  174.  
  175.     SCREEN SHUFFLING
  176.  
  177. I've changed the meaning of the Left-Amiga-M key slightly.  Normally it
  178. pushes the WorkBench screen to the back.  But PopFuncs takes the FRONT
  179. SCREEN and pushes it to the back.  This lets you flip through any screens
  180. that are present, which you couldn't normally do.
  181.  
  182.  
  183.     EXITTING
  184.  
  185. If for some strange reason you'd like to remove PopFuncs from the machine,
  186. SHIFT-ALT-K (for kill) will do the job.  It will display a message about
  187. it's death and you will have to deal with your guilt.
  188.  
  189.  
  190.     WINDOW "LATCHING"
  191.  
  192. Suppose you're running three different programs (like a spreadsheet,
  193. terminal, and database manager) and you're constantly switching between
  194. the different windows.  Wouldn't it be nice if you could just hit a key
  195. and have the spreadsheet window pop to the front and activate, no matter
  196. what screen it was on?  Well that's what PopFuncs' window latching allows
  197. you to do.  It let's you 'latch on' to a window and then recall it
  198. at any time by hitting an appropriate key sequence.  PopFuncs lets you
  199. latch onto up to 9 windows in this way.
  200.  
  201. There are two ways to implement window latching:  The first is by far the
  202. simpler of the two.  Just activate the window you want to latch onto, then
  203. press and hold SHIFT and ALT and then press any of the numbers 1-9 ON THE
  204. NUMERIC KEYPAD.  This causes PopFuncs to remember that window (actually it
  205. remembers the window's title).
  206.  
  207. The second way is to put a definition line in the macro file, detailed
  208. below under MACRO FILE CONTENTS.
  209.  
  210. When you want to recall the latched window, all you have to do is hit
  211. ALT and the NUMERIC KEYPAD number of the window you want to recall.  All
  212. of the windows in the system are then searched to find the one you latched
  213. and it is then popped to the front and activated.  If it can't find the
  214. window (if, for example, it was closed) then nothing will happen.
  215.  
  216. NOTE:  The way PopFuncs remembers a window is by it's title.  It saves
  217. the window's title in memory, and then when you want to find it again, it
  218. searches through all the windows and all the screens and tries to match
  219. it's remembered title to titles on the windows it is searching.  The point
  220. is if you latch onto a window and then the window's title is changed
  221. somehow, PopFuncs will probably not be able to find that window again.
  222.  
  223. ANOTHER NOTE:  If you try to latch onto a window that does not have a title,
  224. (like maybe borderless backdrop windows), then PopFuncs remembers the
  225. SCREEN title.  Then when you call up that latch, it will pop the screen to
  226. the front but it will not activate any windows.
  227.  
  228.  
  229.     THE MACROS
  230.  
  231. Now for what you've all been waiting for... <trumpet fanfare>
  232.  
  233. The macros can have anything you want in them, including some special codes
  234. described below:   ('x' is any ASCII character, 'n' is a digit from 1-9,
  235. 'list' is a list of ASCII characters)
  236.  
  237.     ^x          This let's you embed control characters in the string.
  238.                 EXAMPLE:  ^M is a carriage return.  NOTE:  ^M IS DIFFERENT
  239.                 FROM ^m.  That is, ^M is like hitting shift-control-M, and
  240.                 ^m is just plain control-M.
  241.  
  242.     ~n          This is a simple time delay, where 'n' is a digit from 1-9
  243.                 indicating the length of the delay in seconds.  EXAMPLE:
  244.                 "cd df0:^M~1dir^M" will change directories to df0:, pause for
  245.                 a second, then do a directory.
  246.  
  247.     \           This overrides any of the special codes.  So if you want a
  248.                 "^" in your macro, you'll have to do a "\^".  I tried to
  249.                 make the command codes as obscure as possible, but if this
  250.                 inconveniences anyone, I apologize.  NOTE:  To do a "\",
  251.                 you'll have to do a "\\".
  252.  
  253.     [list]x     This lets you add any qualifiers to a keystroke.  So, if
  254.                 you want to do a CONTROL-LEFT AMIGA-RIGHT SHIFT-LEFT ALT-M,
  255.                 put a "[clta]m" in the macro.  The qualifier codes are:
  256.  
  257.                 c = control
  258.                 l = left amiga
  259.                 r = right amiga
  260.                 a = left alt
  261.                 b = right alt
  262.                 s = left shift
  263.                 t = right shift
  264.  
  265.                 NOTE:  "[c]M" is the same as "[cs]m".
  266.                 NOTE:  If you wanted to have F10 pause PopFuncs, you could
  267.                        make F10 "[a]p" and that would be the same as hitting
  268.                        ALT-P.
  269.                 NOTE:  If you wanted to bind F10 to clicking the left mouse
  270.                        button, you could do "[al]x".  Note that you MUST have
  271.                        an ASCII character after the right bracket, whether
  272.                        it does anything or not (in this case it serves no
  273.                        purpose).
  274.  
  275.     {x}         This lets you put in keystrokes that aren't ASCII
  276.                 characters.  So, if you want to put an up arrow in your
  277.                 macro, do a "{u}".  Codes are as follows:
  278.  
  279.                 u = up arrow                    h   = the help key
  280.                 d = down arrow                  0-9 = numeric keypad numbers
  281.                 l = left arrow                  -   = numeric keypad "-"
  282.                 r = right arrow                 .   = numeric keypad "."
  283.                 t = the tab key                 c   = numeric keypad ENTER
  284.                 e = the escape key              n   = the return key
  285.                 b = the backspace key           x   = the delete key
  286.  
  287.                 NOTE:  You can only put one character within the "{}"s.
  288.                 NOTE:  You can also add qualifiers to these codes, so if
  289.                        you want a SHIFT-TAB, you could do "[s]{t}".
  290.  
  291.     <list>      These are the window manipulation commands.  If you want
  292.                 to bind F10 to shrinking the active window, pushing it to
  293.                 the back, and activating the next window, use "<-ba>".
  294.                 The codes are:
  295.  
  296.                 - = Shrink the currently active window to it's minimum
  297.                     size.  NOTE:  This only works on a window that has
  298.                     a sizing gadget.
  299.                 + = Enlarge the currently active window as far to the right
  300.                     and down as possible.  If you want to make a window
  301.                     the entire screen size, first move the window to the
  302.                     upper left-hand corner (see below), then enlarge it.
  303.                     NOTE:  This only works on a window that has
  304.                     a sizing gadget.
  305.                 b = Push the currently active window to the back.  NOTE:
  306.                     This only works if the window has the depth gadgets.
  307.                 f = Bring the currently active window to the front.  NOTE:
  308.                     This only works if the window has the depth gadgets.
  309.                 a = Activate the next window in the chain of windows.  This
  310.                     will allow you to 'scroll' through the windows in the
  311.                     active screen.
  312.                 7 = Move active window to upper-left hand corner.
  313.                 9 = Move active window to upper-right hand corner.
  314.                 1 = Move active window to lower-left hand corner.
  315.                 3 = Move active window to lower-right hand corner.
  316.                     NOTE:  The codes for the move-window functions above
  317.                            actually do have a meaning.  If you'll notice
  318.                            on the numeric keypad, the 7 is on the upper
  319.                            left, 9 is on the upper right, 1 is on the
  320.                            lower left, and 3 is on the lower right.  This
  321.                            gives a little bit of visual help when moving
  322.                            windows:
  323.  
  324.                                             7     9
  325.                                               \ /
  326.                                                X
  327.                                               / \
  328.                                             1     3
  329.  
  330.     ' (apostrophe)  Use this if you want to put a comment in your macro
  331.                     definition.  EG, "<-baf+>' Shrink window, push to back,
  332.                     activate next, bring to front, enlarge".  Note that this
  333.                     comment extends all the way to the end of the line, so
  334.                     don't try to put anything useful after the comment
  335.                     character.
  336.  
  337.     `command'   Here's an interesting feature that my brother wanted me
  338.                 to include.  Suppose you're typing away at you're CLI
  339.                 and you suddenly realize that you want to run Access! or
  340.                 something.  Well, you can program a function key to
  341.                 execute any program in the background.  For
  342.                 example, if you did a `Terminals:Access!' in one of your
  343.                 macros, then PopFuncs will start up the program Access! on
  344.                 the disk Terminals, assuming the disk Terminals is in a
  345.                 drive.  If it isn't, you'll get the standard "Please insert
  346.                 volume Terminals: in any drive" requester.  Note that
  347.                 PopFuncs prepends 'Run >nil:' onto the beginning of the
  348.                 command, so a program that requires a CLI window will
  349.                 probably not work properly.  This feature
  350.                 would be more useful to somebody with a hard disk, but it
  351.                 is still a handy feature for non-HD users who love to
  352.                 copy gobs and gobs of disks into RAM (like me - I can't
  353.                 wait 'til I get a HD).
  354.                 NOTE:  If you want a function key that simply starts a
  355.                 NewCLI, just program one with "`NewCLI'" and you've got
  356.                 you're own PopCLI.
  357.                 NOTE TOO:  If a program that you start like this requires
  358.                 a CLI window, you might try this:  "`NewCLI'~1ProgramName^M".
  359.                 This will open a NewCLI window, pause for a second, then
  360.                 execute the program as if you had typed it's name into that
  361.                 CLI window.  Most programs compiled with Lattice will require
  362.                 a CLI window, unless you change the startup code so that it
  363.                 doesn't open up that (aggravating and basically useless)
  364.                 stdout window from WB.
  365.  
  366.  
  367.                 WARNING WARNING WARNING WARNING WARNING WARNING WARNING
  368.  
  369.                 IF YOU HAVE RUN POPFUNCS FROM THE WORKBENCH, SOME
  370.                 PROGRAMS MIGHT GURU THE MACHINE IF YOU TRY TO RUN THEM
  371.                 IN THE BACKGROUND.  THIS ALSO HAPPENS IF YOU HAVE RUN
  372.                 POPFUNCS FROM CLI AND REMOVE THE CLI WINDOW IT WAS STARTED
  373.                 FROM.  Programs that this happens with that I've found
  374.                 so far are:  Access! (sometimes) and Deluxe Music.  If you
  375.                 discover another program that gurus PLEASE LET ME KNOW!
  376.                 I'm tearing my hair out over this one...
  377.  
  378.  
  379.  
  380.     EXAMPLE MACROS
  381.  
  382. Here's some macro examples:
  383.  
  384.     "cd df0:^M"     Pretty self explanatory.  Writes "cd df0:" and places
  385.                     a carriage return on the end.
  386.  
  387.     "[sa]k"         This would be the same as hitting SHIFT-ALT-K.  This
  388.                     would effectively remove PopFuncs.
  389.  
  390.     "[s]{d}"        This is the equivalent of hitting SHIFT-DOWN ARROW. If
  391.                     you were running an editor like Memacs or DME, then
  392.                     this would move the cursor down a page.
  393.  
  394.     "<af+>"         This will activate the next window, bring it to the
  395.                     front and expand it to full screen size.
  396.  
  397.     "\'Hello\'"     This prints the message "'Hello'".  Note that the
  398.                     back slashes are necessary since "'" is the symbol
  399.                     for a comment.
  400.  
  401.     "`C:PopCalc'"   This runs the program C:PopCalc in the background.
  402.                     (If you're wondering what PopCalc is, it's another
  403.                     program I'm working on.  It's basically a full-
  404.                     featured scientific calculator that you can call up
  405.                     at the touch of a 'hot key'.  I should be releasing
  406.                     it soon.)
  407.  
  408.     "`NewCLI'~1<7+>Conquest^M~9<b>"  I dedicate this one to my brother David,
  409.                                 the world's most avid 'Conquest' player.
  410.                                 This starts a new CLI, pauses a second
  411.                                 to give it time to do stuff, enlarges the
  412.                                 CLI to full screen size, then executes
  413.                                 the game Conquest (assuming it's in the
  414.                                 current directory - you might have to put
  415.                                 a path name in front of it to make it
  416.                                 look in a specific place).  After that it
  417.                                 waits 9 seconds for the game to load in,
  418.                                 then pushes the active window (which is
  419.                                 that little tiny window in the lower right)
  420.                                 to the back so it's out of the way.
  421.  
  422.  
  423.  
  424.     MACRO FILE CONTENTS
  425.  
  426. The macro file format is very simple.
  427.  
  428. The first line contains the screen blanking information as follows:
  429.  
  430.     B=n
  431.  
  432. where 'n' is a decimal number indicating the number of minutes that must
  433. elapse with no activity before the screen will blank.  The maximum value
  434. for this number is 65535 (yes, that's a word).
  435.  
  436.  
  437. The next three lines contain the 'hot key' definitions in the
  438. following format:
  439.  
  440.     Kill hot-key
  441.     Redefine hot-key
  442.     Pause hot-key
  443.  
  444. Each line should only have a single ASCII character on it.
  445.  
  446.  
  447. The next lines contain the latch definitions.  There can be any number of
  448. lines here, but remember that you can only program 9 window latches.  Each
  449. latch line has the following format:
  450.  
  451. LATCH n,string
  452.  
  453. where 'n' is a numeric digit from 1-9, and 'string' is any string of
  454. ASCII text characters.  'n' is the numeric keypad number (along with ALT)
  455. that you press in order to bring up this latch, and 'string' is the
  456. window title that PopFuncs looks for (see WINDOW LATCHING above).  Note
  457. that you don't have to put in the window's entire title, for example:
  458.  
  459. LATCH 1,Left
  460.  
  461. will match any of the following window titles:  "Left", "LeftWing", "Lefty",
  462. "Left or Right".
  463.  
  464.  
  465. The next twenty lines are the macro texts, in order from F1 through S10.  If
  466. you only have 12 defined, then it's okay to leave the other eight off, but
  467. if you have a blank macro between to others, you MUST leave a blank line
  468. in the macro file.
  469.  
  470.  
  471.     SAMPLE MACRO FILE
  472.  
  473. B=15                        <- sets blanking interval to 15 minutes
  474. K                           <- binds SHIFT-ALT-K to killing PopFuncs
  475. D                           <- binds ALT-D to popping up the define window
  476. P                           <- binds ALT-P to 'pausing' PopFuncs
  477. LATCH 1,AmigaShell          <- latch onto a window with a title of "AmigaShell*"
  478. LATCH 4,2
  479. cd df0:^M
  480. cd df1:^M
  481. cd vd0:^M
  482.                             <- these blank lines are required if you
  483.                             <-   want to leave a macro blank.
  484. dir^M
  485. <baf>
  486.  
  487.  
  488.     IN THE FUTURE
  489.  
  490. Here are some things I intend to put into PopFuncs in the future.  If you
  491. have any suggestions, let me know.
  492.  
  493.     - Support for the AREXX stuff.  I'm not quite sure how to work this yet,
  494.       but my brother insists on me adding it in, so I'll look into it.
  495.     - A better file requester.  Something small in code size, but useful.
  496.     - I also hope to shrink the actual code size.  I was shooting for about
  497.       7K when I started this thing, but it quickly grew when I started
  498.       adding additional features.  The entire thing is written in Assembly,
  499.       so it's not as big as it could be.  (Actually, my first version was
  500.       written with Lattice C, and with only half the features it was 29K.
  501.       Fortunately, the disk it was on corrupted and I had to rewrite the
  502.       thing in assembly.  That's why this is 2.1 instead of 1.1)
  503.  
  504.  
  505.     CONCLUSION
  506.  
  507. Well, I think that about covers everything.  I hope somebody out there
  508. finds a use for this program.
  509.  
  510.         -Tom-
  511.  
  512. (This is my first REAL program, by the way.)
  513.  
  514.